Certain embodiments of the present invention relate generally to digital graphics processing. More specifically, certain embodiments relate to a method and apparatus for updating a color look-up table (CLUT).
Currently, several graphical image file formats exists. Some of these graphical image file formats may be machine dependent, operating system (OS) dependent or cross-platform independent. Notwithstanding, graphic image file format translators exists that may transform images from one file format to another. Some of the most popular graphical file format may include, but are not limited to, joint photographic expert group (JPEG), graphic interchange format (GIF), tagged image file format (TIFF), bitmap (BMP) and motion picture expert group (MPEG). JPEG, GIF, TIFF, and BMP, may generally be utilized for still graphic images, while MPEG may generally be utilized for moving graphic images.
It may often be necessary to reduce the size of an original image to ensure that any resulting image file may be small enough to require a minimal amount of storage. Additionally, the smaller the size of an image, the faster it may be transferred and/or displayed on a video display terminal. In general, graphic image file formats may incorporate some form of compression technique or scheme, which may effectively reduce the size of the image. These compression techniques may be lossy or lossless. Lossy compression techniques may reduce the size of an original image by removing actual image data from the original image. In this regard, a noticeable degradation may occur in the quality of any resulting image. Although, the resulting image may differ from the original image, in few instances, the difference may not be readily discernible by the human eye. Lossless compression techniques may reduce the size of an original image by utilizing certain algorithms that may permit the original image to be reproduced without any loss of the original image data. In this regard, the resulting image may differ from the original image, but in some instances, the difference may not be readily discernible.
Even though compression techniques may be used to compress graphic images, graphics processors may have to decompress some image file formats before actual images may be displayed on a display terminal such as a video display terminal. Significant amounts of processing power may be required, even in cases that may utilize dedicated graphics processing elements. These graphics processing elements may include, but are not limited to, graphics engines and graphics processors or coprocessors. A similar situation may apply in cases where the graphic image or data may not be in a compressed format.
To reduce processing requirements, some systems may utilize a color look-up table (CLUT). A CLUT may be a table stored in memory that may contain representative pixel information that may be utilized for reproduction and display of a graphic image. The CLUT may be viewed as a compression scheme in which pixel values for a bitmap image may be used as an index into a color translation table. Entries in the color translation table may define colors that may have more bits per pixel than the pixel values used to represent the bitmap image. For example, a system that utilizes four (4) bits to represent a pixel may have a CLUT with 24 or sixteen (16) possible values. However, there may be two (2) or more CLUTs, thereby extending the number of colors beyond sixteen (16) that may be represented by the four (4) bits. Similarly, a system that utilizes eight (8) bits to represent a pixel may have a CLUT with 28 or two hundred and fifty six (256) possible values. However, there may be two (2) or more CLUTs, thereby extending the number of colors that may be represented by the eight (8) bits significantly beyond two hundred and fifty six (256). In this case, if there are n CLUTs, then 256n colors may possibly be represented. Notwithstanding, one drawback with such a scheme would be the vast amount of memory that would be required to store the CLUT. Additionally, extensive amounts of processing power may be required to, for example, read and update the CLUT.
In systems that utilize a CLUT, buffers containing graphic data may be utilized for displaying a line of graphics at a time. In this regard, at least those portions of buffers containing information for a current line of graphics image data may be flushed or overwritten once a current line of graphics data has been displayed. The CLUT containing pertinent information about the pixels for the current line being displayed may only be updated after the information for the current line has been displayed. Hence, the CLUT containing information for the current line being displayed may not be updated prior to completion of the display of the current line, since doing so would result in at least a partial destruction of any existing graphic image being displayed. Accordingly, a need exists for an approach to update a color look-up table (CLUT) for a next line of graphics before the current line of graphics is finished being read out of a FIFO and processed for color.
Further limitations and disadvantages of conventional and traditional approaches will become apparent to one of skill in the art, through comparison of such systems with some aspects of the present invention as set forth in the remainder of the present application with reference to the drawings.